<template>
  <div class="home">
    <el-card>
      <p>（{{homeData.outFactory}}）</p>
      <p @click="$router.push({path:'/factoryExitList'})">酒厂待出库</p>
    </el-card>
    <el-card>
      <p>（{{homeData.inCellarOrder}}）</p>
      <p @click="$router.push({path:'/Winecellar'})">酒窖待入库</p>
    </el-card>
     <el-card>
      <p>（{{homeData.pickOutOrder}}）</p>
      <p @click="$router.push({path:'/Selfraisedinventory'})">酒窖待自提出库</p>
    </el-card>
    <el-card>
      <p :class="{'red':homeData.cashTransfer<10000}">（{{homeData.cashTransfer}}元）</p>
      <p @click="$router.push({path:'/fundsDetail'})">预存款预警</p>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      homeData: {},
    }
  },
  mounted() {
    this.getHomeData();
  },
  methods: {
    async getHomeData() {
      let { data } = await this.$post({
        api: '/show/indexdata'
      });
      if (data.code === 0) {
        this.homeData = data.data;
      } else {
        this.$message({
          type: 'error',
          message: data.msg
        });
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.home {
  overflow: hidden;
  .el-card {
    float: left;
    width: 45%;
    padding: 50px 0;
    margin: 30px 2.2%;
    text-align: center;
    font-size: 16px;
    line-height: 50px;
    p:first-child {
      font-size: 24px;
    }
    p:last-child{
      cursor: pointer;
      &:hover{
        color: #2d8cf0 ;
      }
    }
  }
  .red{
    color: red;
  }
}
</style>
